Skip to main content

setCollateralAmount

readonly setCollateralAmount!: ( lovelaces: number | bigint ) => TxBuilderRunner
  • lovelaces: number | bigint

Sets the collateral input, and optionally output, for a transaction.

If setCollateral is not used, but the transaction needs collateral due to the presence of a plutus script, the TxBuilderRunner instance will try to use one of the normal inputs as collateral, see setCollateralAmount for more infos.

collateral can either be a resolved UTxO or an unresolved ITxOutRef

in case it is an unresolved ITxOutRef a call to the ITxRunnerProvider resolveUtxos method is done in the build method; if resolveUtxos is missing on the provider the build method will throw an Error.

an additional collateralOutput may be specified.

returns a reference to the same TxBuilderRunner.